package com.example.droolstool.controller;

import com.example.droolstool.module.ServerAssembleModule;
import com.example.droolstool.service.ExecuteDrlAssembleServerImpl;
import com.example.droolstool.service.ServerRegisterServiceImpl;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author 赵云龙
 * @Date 2020/6/26
 * @Description TODO
 */

@RestController
public class ServerAssembleController {

    @Resource
    ServerRegisterServiceImpl serverRegisterService;
    @Resource
    ExecuteDrlAssembleServerImpl executeDrlAssembleServer;

    @PostMapping("serverRegister")
    public void serverRegister(@RequestBody ServerAssembleModule serverAssembleModule){
        try {
            serverRegisterService.serverRegister(serverAssembleModule);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @PostMapping("executeDrl")
    public void executeDrl(String id){
        try {
            executeDrlAssembleServer.executeDrl(id);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
